﻿/*
 * @author: wizardc
 */

using System.Collections.Generic;

namespace DouEditor.Const
{
    public static class BuildConst
    {
        /// <summary>
        /// 不需要计算依赖的资源
        /// </summary>
        public static readonly HashSet<string> IgnoreDependsFileExt = new HashSet<string>
        {
            "",
            ".wav",
            ".ogg",
            ".mp3",
            ".mp4",
            ".bytes",
            ".anim",
            ".cs",
            ".dll",
            ".pdb",
            ".txt",
            ".hlsl",
            ".json",
            ".asmdef",
            ".meta",
        };

        /// <summary>
        /// 所有需要打包的资源的根目录
        /// </summary>
        public const string ABResFolder = "Assets/Res/";

        /// <summary>
        /// 发布文件夹的固定名称
        /// 因为 Unity 会生成一个包含了所有 AB 文件关系的文件（该其中仅包含一个名为"assetbundlemanifest"的AssetBundleManifest类型的文件），该文件名和发布文件夹名一致且无后缀名
        /// 为了固定该文件的名称，就强制下发布文件夹的名称以便保证
        /// </summary>
        public const string BuildFolderName = "StreamingAssets";

        /// <summary>
        /// ResourceManifest 文件名
        /// </summary>
        public const string ResourceManifestName = "rm.list";
        
        /// <summary>
        /// HotFixedManifest 文件名
        /// </summary>
        public const string HotFixedManifestName = "hfm.list";
        
        /// <summary>
        /// AB 包后缀名
        /// </summary>
        public const string ABExtension = ".ab";
        
        /// <summary>
        /// 着色器 AB 包名
        /// </summary>
        public const string ShaderABName = "shader" + ABExtension;

        /// <summary>
        /// manifest 文件后缀
        /// </summary>
        public const string ManifestExtension = ".manifest";
        
        /// <summary>
        /// 一般项目内 TA 提供的 Shader 目录，该目录下的 Shader 会全部打包
        /// </summary>
        public static readonly string[] ShaderFolder = {
            "Assets/Res/Shader",
        };

        /// <summary>
        /// 项目中所有用到的 Shader 变体材质创建地址
        /// </summary>
        public const string ShaderVariantMaterialCreatePath = "Assets/ShaderVariantMaterial/";

        /// <summary>
        /// 动态设置的着色器关键字配置文件地址
        /// </summary>
        public const string DynamicShaderVariantFilePath = ShaderVariantMaterialCreatePath + "DynamicShaderVariant.asset";
        
        /// <summary>
        /// Shader 变体收集文件创建地址
        /// </summary>
        public const string ShaderVariantCollectionCreatePath = ABResFolder + "ShaderVariantCollection/svc.shadervariants";

        /// <summary>
        /// 提取公用资源的 AB 包包名前缀
        /// </summary>
        public const string DependABNamePrefix = "Depend/";

        /// <summary>
        /// 图集文件生成目录
        /// </summary>
        public const string AtlasDefineFolder = ABResFolder + "Atlas/";
        
        /// <summary>
        /// 图集零散小图目录
        /// </summary>
        public const string AtlasSpriteFolder = ABResFolder + "Sprite/";
    }

    public static class BuildTimeConst
    {
        public const string BuildAllTime = "BuildAllTime";
    }
}
